package com.test04_数组;

import org.junit.Test;

/**
 * JDK内置数组操作方法
 */
public class YootkDemo_04 {

    @Test
    public void test1() {
        int arrayA[] = new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9};
        int arrayB[] = new int[]{11, 22, 33, 44, 55, 66, 77, 88, 99};
        System.arraycopy(arrayA, 4, arrayB, 2, 3);  // 数组拷贝
        for (int x : arrayB) {
            System.out.print(x + "、");
        }
    }

    @Test
    public void test2() {
        int array[] = new int[]{8, 1, 3, 6, 2, 9, 10};
        java.util.Arrays.sort(array);   // 数组排序
        for (int x : array) {
            System.out.print(x + "、");
        }
    }
}
